<style>
    #reportSurveyRecord-edit .layui-form-label {
        width:145px;
    }
    #reportSurveyRecord-edit .layui-input-block {
        margin-left: 175px;
        margin-right: 10px;
    }
    #reportSurveyRecord-edit .layui-input-block-detail {
        margin-top: 8px;
    }
    #reportSurveyRecord-edit .grey-input{
        background-color: #dfa7a73b;
    }
    #reportSurveyRecord-edit .iconSpan{
        color: cornflowerblue;
        cursor: pointer;
    }
    #reportSurveyRecord-edit .layui-panel{
        margin-top: 10px;
    }
    #reportSurveyRecord-edit .addBtn{
        margin-top: 5px;
    }
</style>
<div class="febs-container" id="reportSurveyRecord-edit">
    <div class="febs-open-body">
        <form class="layui-form" action="" lay-filter="reportSurveyRecord-edit-form">

                <!--  调查信息-->
                <div class="layui-card">
                    <blockquote class="layui-elem-quote layui-elem-quote-primary">调查结果</blockquote>
                    <div class="layui-card-body">
                        <div class="layui-form-item febs-hide">
                            <label class="layui-form-label febs-form-item-require">：报告id</label>
                            <div class="layui-input-block">
                                <input type="text" name="reportId" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-row">
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label">事故编号：</label>
                                    <div class="layui-input-block" style="margin-top: 8px;">
                                        <span id="accidentInfoShow" class="layui-icon layui-icon-eye iconSpan" th:text="${accidentReport.accidentNo}"></span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-row">
                                <div class="layui-col-xs12">
                                    <label class="layui-form-label febs-form-item-require">事故经过描述：</label>
                                    <div class="layui-input-block">
                                                <textarea type="text" name="accidentElapse" autocomplete="off" class="layui-textarea" minlength="2"
                                                          maxlength="255" placeholder="请输入事故经过描述" lay-verify="required"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-col-md4">
                                <div class="layui-form-item">
                                    <label class="layui-form-label ">项目名称：</label>
                                    <div class="layui-input-block">
                                        <select name="projectId" id="projectId" lay-filter="projectId">
                                            <option value="">请选择</option>
                                            <option th:each="item:${projectList}"
                                                    th:value="${item.projectId}" th:text="${item.projectName}"
                                                    th:selected="${accidentReport.projectId ==item.projectId}"
                                            >
                                            <input type="text" name="projectName" class="febs-hide">
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-md4">
                                <label class="layui-form-label ">区域位置：</label>
                                <div class="layui-input-block">
                                    <select name="accidentAreaId" id="accidentAreaId" lay-search="" lay-filter="accidentAreaId" >
                                    </select>
                                    <input type="text" name="accidentAreaName" class="febs-hide">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-row">
                                <div class="layui-col-xs12">
                                    <label class="layui-form-label">具体位置：</label>
                                    <div class="layui-input-block">
                                                <textarea type="text" name="detailPlace" autocomplete="off" class="layui-textarea" minlength="2"
                                                          maxlength="255" placeholder="请输入具体位置" ></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-row">
                                <label class="layui-form-label ">事故图解：</label>
                                <div class="layui-input-block">
                                    <div id="fileUploadReportImg" style="height: 120px ;width: 100%">
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-row">
                                <label class="layui-form-label">时间线：</label>
                                <div class="layui-input-block">
                                    <button type="button" class="layui-btn layui-btn-sm addBtn" id="addTimeline">
                                        <span class="layui-icon layui-icon-add-1" ></span>添加
                                    </button>
                                </div>
                                <div class="layui-input-block">
                                    <div class="jhg-body-table">
                                        <table lay-filter="timelineTable" id="timelineTable" lay-data="{id: 'timelineTable'}"></table>
                                    </div>
                                </div>
                            </div>
                        </div>
<!--                        <div class="layui-form-item">-->
<!--                            <div class="layui-row">-->
<!--                                <label class="layui-form-label ">时间线：</label>-->
<!--                                <div class="layui-input-block">-->
<!--                                    <div class="layui-container">-->
<!--                                    <div class="layui-timeline">-->
<!--                                        <div class="layui-timeline-item">-->
<!--                                            <i class="layui-icon layui-timeline-axis">&#xe63f;</i>-->
<!--                                            <div class="layui-timeline-content layui-text">-->
<!--                                                <h3 class="layui-timeline-title">2023年3月1日</h3>-->
<!--                                                <p>发生的重要事件...</p>-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                        &lt;!&ndash; 更多时间线项... &ndash;&gt;-->
<!--                                    </div>-->
<!--                                </div>-->
<!--                                </div>-->
<!--                            </div>-->
<!--                        </div>-->
                        <div class="layui-form-item">
                            <div class="layui-row">
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label">应急反应级别：</label>
                                    <div class="layui-input-block">
                                        <select name="emergencyLevel" id="emergencyLevel" >
                                            <option value="">请选择</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label">事故性质：</label>
                                    <div class="layui-input-block">
                                        <select name="accidentNature" id="accidentNature" >
                                            <option value="">请选择事故性质</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label">违反保命规则：</label>
                                    <div class="layui-input-block">
                                        <select name="violationSurvivalRules" id="violationSurvivalRules" >
                                            <option value="">请选择违反保命规则</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-row">
                                <div class="layui-col-xs12">
                                    <label class="layui-form-label ">应急处理情况：</label>
                                    <div class="layui-input-block">
                                                <textarea type="text" name="emergencyOverview" autocomplete="off" class="layui-textarea" minlength="2"
                                                          maxlength="255" placeholder="请输入应急处理情况" ></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-row">
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label febs-form-item-require">事故类别：</label>
                                    <div class="layui-input-block">
                                        <select name="accidentCategory" id="accidentCategory" lay-verify="required">
                                            <option value="">请选择事故类别</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label febs-form-item-require">事故类型：</label>
                                    <div class="layui-input-block">
                                        <select name="accidentType" id="accidentType" lay-verify="required">
                                            <option value="">请选择事故类型</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label">事故等级：</label>
                                    <div class="layui-input-block">
                                        <select name="accidentLevel" id="accidentLevel" >
                                            <option value="">请选择事故等级</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-row">
                                <div class="layui-col-xs12">
                                    <label class="layui-form-label">事故概况：</label>
                                    <div class="layui-input-block">
                                                <textarea type="text" name="accidentOverview" autocomplete="off" class="layui-textarea" minlength="2"
                                                          maxlength="800" placeholder="请输入事故概况" ></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item" >
                            <div class="layui-row">
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label febs-form-item-require">事故原因：</label>
                                    <div class="layui-input-block">
                                        <select name="accidentReason"  id="accidentReason" lay-verify="required">
                                            <option value="">请选择</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-row">
                                <label class="layui-form-label ">事故分析图：</label>
                                <div class="layui-input-block">
                                    <div id="fileUploadReportAnalysis" style="height: 120px ;width: 100%">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item" >
                            <div class="layui-row">
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label ">直接原因：</label>
                                    <div class="layui-input-block">
                                        <select name="directReason" id="directReason" >
                                            <option value="">请选择</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item" >
                            <div class="layui-row">
                                <div class="layui-col-xs12">
                                    <label class="layui-form-label">直接原因补充：</label>
                                    <div class="layui-input-block">
                                                <textarea type="text" name="directReasonRemark" autocomplete="off" class="layui-textarea" minlength="2"
                                                          maxlength="255" placeholder="请输入直接原因补充" ></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item" >
                            <div class="layui-row">
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label">间接原因：</label>
                                    <div class="layui-input-block">
                                        <select name="indirectionReason" id="indirectionReason">
                                            <option value="">请选择</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item" >
                            <div class="layui-row">
                                <div class="layui-col-xs12">
                                    <label class="layui-form-label">间接原因补充：</label>
                                    <div class="layui-input-block">
                                                <textarea type="text" name="indirectionReasonRemark" autocomplete="off" class="layui-textarea" minlength="2"
                                                          maxlength="255" placeholder="请输入间接原因补充" ></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item" >
                            <div class="layui-row">
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label">根本原因：</label>
                                    <div class="layui-input-block">
                                        <select name="rootReason" id="rootReason">
                                            <option value="">请选择</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item" >
                            <div class="layui-row">
                                <div class="layui-col-xs12">
                                    <label class="layui-form-label">根本原因补充：</label>
                                    <div class="layui-input-block">
                                                <textarea type="text" name="rootReasonRemark" autocomplete="off" class="layui-textarea" minlength="2"
                                                          maxlength="255" placeholder="请输入根本原因补充" ></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-row">
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label">直接经济损失：</label>
                                    <div class="layui-input-block">
                                        <input type="number" name="economyLoss" autocomplete="off" class="layui-input"
                                               placeholder="请输入直接经济损失">
                                    </div>
                                </div>
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label">间接经济损失：</label>
                                    <div class="layui-input-block">
                                        <input type="number" name="indirectLoss" autocomplete="off" class="layui-input"
                                               placeholder="请输入间接经济损失">
                                    </div>
                                </div>
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label">经济损失（总）：</label>
                                    <div class="layui-input-block">
                                        <input type="number" name="totalLoss" autocomplete="off" class="layui-input"
                                               placeholder="请输入经济损失（总）">
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-row">
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label">损失工时（总）：</label>
                                    <div class="layui-input-block">
                                            <input type="text" name="totalLossHours" autocomplete="off" class="layui-input"
                                                   maxlength="4"  onkeyup="value=value.replace(/[^\d]/g,'')" placeholder="请输入损失工时（总）">
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-row">
                                <div class="layui-col-xs12">
                                    <label class="layui-form-label">环境影响：</label>
                                    <div class="layui-input-block">
                                                <textarea type="text" name="environmentEffect" autocomplete="off" class="layui-textarea" minlength="2"
                                                          maxlength="800" placeholder="请输入环境影响" ></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-row">
                                <div class="layui-col-xs12">
                                    <label class="layui-form-label">分析及处理建议：</label>
                                    <div class="layui-input-block">
                                                <textarea type="text" name="accidentAnalysis" autocomplete="off" class="layui-textarea" minlength="2"
                                                          maxlength="800" placeholder="请输入分析及处理建议" ></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-row">
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label febs-form-item-require">责任人姓名：</label>
                                    <div class="layui-input-block" style="position: relative">
                                        <input type="text" name="obligationUserId" class="febs-hide">
                                        <input type="text" name="obligationPostId" id="obligationPostId0" class="febs-hide">
                                        <input type="text" name="obligationUserName" class="febs-hide">
                                        <input type="text" name="obligationRealName" autocomplete="off" class="layui-input"
                                               minlength="2" maxlength="10" id="inputAutoLeader" placeholder="请选择责任人" lay-verify="required">
                                        <div class="layui-input-suffix" id="obligationDeptName">
                                            <i class="layui-icon layui-icon-add-1"></i>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label">责任比例(%)：</label>
                                    <div class="layui-input-block">
                                        <input type="number" name="obligationRatio" autocomplete="off" class="layui-input"
                                               placeholder="请输入责任比例" lay-verify="obligationRatio">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item"  >
                            <div class="layui-row">
                                <div id="showLeaderUserInfo" >
                                    <div class="layui-col-xs4">
                                        <label class="layui-form-label">责任部门：</label>
                                        <div class="layui-input-block layui-input-block-detail">
                                            <input type="text" name="obligationDeptId" class="febs-hide">
                                            <input type="text" name="obligationDeptName" autocomplete="off" class="layui-input febs-hide"
                                                   minlength="2" maxlength="10" disabled>
                                            <span id="obligationDeptNameDiv">
                                            </span>
                                        </div>
                                    </div>
                                    <div class="layui-col-xs4">
                                        <label class="layui-form-label">责任人岗位：</label>
                                        <div class="layui-input-block layui-input-block-detail">
                                            <input type="text" name="obligationPostName" id="obligationPostName0" autocomplete="off" class="layui-input febs-hide"
                                                   minlength="2" maxlength="10" disabled>
                                            <span id="obligationPostNameDiv">
                                            </span>
                                        </div>
                                    </div>
                                    <div class="layui-col-xs4">
                                        <label class="layui-form-label">责任人工号：</label>
                                        <div class="layui-input-block layui-input-block-detail">
                                            <input type="text" name="obligationUserNo" autocomplete="off" class="layui-input febs-hide"
                                                   minlength="2" maxlength="10" disabled>
                                            <span id="obligationUserNoDiv">
                                            </span>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-row">
                                <div class="layui-col-xs12">
                                    <label class="layui-form-label">责任认定：</label>
                                    <div class="layui-input-block">
                                                <textarea type="text" name="obligationCognizance" autocomplete="off" class="layui-textarea" minlength="2"
                                                          maxlength="800" placeholder="请输入责任认定" ></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-row">
                                <div class="layui-col-xs12">
                                    <label class="layui-form-label">责任人追究：</label>
                                    <div class="layui-input-block">
                                                <textarea type="text" name="obligationDisposeCondition" autocomplete="off" class="layui-textarea" minlength="2"
                                                          maxlength="800" placeholder="请输入责任人追究" ></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-row">
                                <label class="layui-form-label">肇事人员：</label>
                                <div class="layui-input-block">
                                    <button type="button" class="layui-btn layui-btn-sm addBtn" id="addCulpritUser">
                                        <span class="layui-icon layui-icon-add-1" ></span>人员选择
                                    </button>
                                </div>
                                <div class="layui-input-block">
                                    <div class="jhg-body-table">
                                        <table lay-filter="culpritUserTable" id="culpritUserTable" lay-data="{id: 'culpritUserTable'}"></table>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-row">
                                <label class="layui-form-label">伤亡人员：</label>
                                <div class="layui-input-block">
                                    <button type="button" class="layui-btn layui-btn-sm addBtn" id="addInjuryUser">
                                        <span class="layui-icon layui-icon-add-1" ></span>人员选择
                                    </button>
                                </div>
                                <div class="layui-input-block">
                                    <div class="jhg-body-table">
                                        <table lay-filter="injuryUserTable" id="injuryUserTable" lay-data="{id: 'injuryUserTable'}"></table>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item" style="color: blue;">
                            <div class="layui-row">
                                <div class="layui-col-xs3">
                                    <label class="layui-form-label">死亡人数：</label>
                                    <div class="layui-input-block layui-input-block-detail">
                                        <input type="text" name="deathToll" autocomplete="off" class="layui-input febs-hide"
                                               minlength="2" maxlength="10" disabled>
                                        <span id="deathTollSpan">
                                        </span>
                                    </div>
                                </div>
                                <div class="layui-col-xs3">
                                    <label class="layui-form-label">重伤人数：</label>
                                    <div class="layui-input-block layui-input-block-detail">
                                        <input type="text" name="severeInjuryToll" autocomplete="off" class="layui-input febs-hide"
                                               minlength="2" maxlength="10" disabled>
                                        <span id="severeInjuryTollSpan">
                                        </span>
                                    </div>
                                </div>
                                <div class="layui-col-xs3">
                                    <label class="layui-form-label">轻伤人数：</label>
                                    <div class="layui-input-block layui-input-block-detail">
                                        <input type="text" name="slightInjuryToll" autocomplete="off" class="layui-input febs-hide"
                                               minlength="2" maxlength="10" disabled>
                                        <span id="slightInjuryTollSpan">
                                        </span>
                                    </div>
                                </div>
                                <div class="layui-col-xs3">
                                    <label class="layui-form-label">失踪人数：</label>
                                    <div class="layui-input-block layui-input-block-detail">
                                        <input type="text" name="missingToll" autocomplete="off" class="layui-input febs-hide"
                                               minlength="2" maxlength="10" disabled>
                                        <span id="missingTollSpan">
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-row">
                                <div class="layui-col-xs12">
                            <div class="layui-form-item">
                                <label class="layui-form-label">调查附件：</label>
                                <div class="layui-input-block" id="uploadBtn">
                                </div>
                            </div>
                        </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!--            调查审核记录-->
                <div class="layui-card" th:if="${not #lists.isEmpty(accidentReport.surveyAuditRecordList)}">
                    <blockquote class="layui-elem-quote layui-elem-quote-primary">审核记录</blockquote>
                    <div class="layui-card-body" id="box-audit">
                        <div class="layui-form-item">
                            <div class="layui-row">
                                <label class="layui-form-label layui-form-label-detail">审核记录：</label>
                                <div class="layui-input-block">
                                    <div class="jhg-body-table">
                                        <table lay-filter="surveyAuditRecord" id="surveyAuditRecord" lay-data="{id: 'surveyAuditRecord'}"></table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!--  事故原因-->
<!--                <div class="layui-card">-->
<!--                    <blockquote class="layui-elem-quote layui-elem-quote-primary">事故原因</blockquote>-->
<!--                    <div class="layui-card-body" id="reason_box">-->
<!--                        <div class="layui-form-item layui-row-button" >-->
<!--                            <div class="layui-inline add-group-btn" >-->
<!--                                <div id="addReason" class="layui-btn jhg-normal-btn layui-btn-sm">-->
<!--                                    <em class="layui-icon">&#xe654;</em> 添加事故原因-->
<!--                                </div>-->
<!--                            </div>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->

                <!--  整改措施-->
                <div class="layui-card">
                    <blockquote class="layui-elem-quote layui-elem-quote-primary">整改措施</blockquote>
                    <div class="layui-card-body" id="reason_box">
                        <div class="layui-form-item layui-row-button" >
                            <div class="layui-inline add-group-btn" >
                                <div id="addOpinion" class="layui-btn jhg-normal-btn layui-btn-sm">
                                    <em class="layui-icon">&#xe654;</em> 添加整改措施
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

        <div class="layui-form-item febs-hide">
            <button class="layui-btn" lay-submit="" lay-filter="reportSurveyRecord-edit-form-save" id="save"></button>
            <button class="layui-btn" lay-submit="" lay-filter="reportSurveyRecord-edit-form-submit" id="submit"></button>
            <button type="reset" class="layui-btn" id="reset"></button>
        </div>
    </form>
    </div>
</div>
<script type="text/html" id="injury-level">
    <select name="injuryLevel" lay-filter="injuryLevel" lay-verify="required" class="sel-main-table-list" >
        <option value="">请选择</option>
        <option value="1" {{'1' === d.injuryLevel ? 'selected' : '' }}>轻伤</option>
        <option value="2" {{'2' === d.injuryLevel ? 'selected' : '' }}>重伤</option>
        <option value="3" {{'3' === d.injuryLevel ? 'selected' : '' }}>死亡</option>
        <option value="4" {{'4' === d.injuryLevel ? 'selected' : '' }}>失踪</option>
    </select>
</script>
<script type="text/html"  id="accident-time">
    <input type="text" name="accidentTime" value="{{ d.accidentTime  }}"
            class="layui-input accidentTimeClass"
            placeholder="请输入时间" autocomplete="off" readonly="readonly" lay-verify="required">
</script>
<script type="text/html" id="injury-user-option">
    <a lay-event="del-injury-user" ><em class="layui-icon febs-edit-area febs-red">&#xe7f9;</em></a>
</script>
<script type="text/html" id="culprit-user-option">
    <a lay-event="del-culprit-user" ><em class="layui-icon febs-edit-area febs-red">&#xe7f9;</em></a>
</script>
<script type="text/html" id="accident-time-option">
    <a lay-event="del-accident-time" ><em class="layui-icon febs-edit-area febs-red">&#xe7f9;</em></a>
</script>
<script type="text/html" id="survey-file-option">
    <a lay-event="del-survey-file" ><em class="layui-icon febs-edit-area febs-red">&#xe7f9;</em></a>
</script>
<script data-th-inline="javascript">
    var accidentReportData = [[${accidentReport}]];
</script>
<script th:src="@{/febs/js/accidentReport/reportSurveyRecord.js(v=1)}"></script>